//
// cocos2d Hello World example
// http://www.cocos2d-iphone.org
//

// Import the interfaces
#import "HelpScene.h"
#import "SimpleAudioEngine.h"
#import "MainScene.h"

// HelloWorld implementation
@implementation HelpScene

+(id) scene
{
	// 'scene' is an autorelease object.
	Scene *scene = [Scene node];
	
	// 'layer' is an autorelease object.
	HelpScene *layer = [HelpScene node];
	
	// add layer as a child to scene
	[scene addChild: layer];
	
	// return the scene
	return scene;
}

// on "init" you need to initialize your instance
-(id) init
{
	// always call "super" init
	// Apple recommends to re-assign "self" with the "super" return value
	if( (self=[super init] )) {
		
		Sprite *background = [Sprite spriteWithFile:@"helppage.png"];
		[background setPosition:ccp(240, 160)];
		[self addChild:background z:0];
		
		BitmapFontAtlas *labelBack = [BitmapFontAtlas bitmapFontAtlasWithString:@"Back" fntFile:@"fort32.fnt"];
		MenuItem *itemBack = [MenuItemLabel itemWithLabel:labelBack target:self selector:@selector(GoBack:)];
		Menu *menu = [Menu menuWithItems:itemBack, nil];
		menu.position = ccp(430, 50);
		[self addChild:menu];
		
	}
	return self;
}

// on "dealloc" you need to release all your retained objects
- (void) dealloc
{
	// in case you have something to dealloc, do it in this method
	// in this particular example nothing needs to be released.
	// cocos2d will automatically release all the children (Label)
	
	// don't forget to call "super dealloc"
	[super dealloc];
}

- (void) GoBack: (id) sender
{
	[[Director sharedDirector] replaceScene:[FlipXTransition transitionWithDuration:1 scene:[MainScene node]]];
}

@end
